package model

type ProjectSlice []*Project

func (p ProjectSlice) Len() int {
	return len(p)
}

func (p ProjectSlice) Less(i, j int) bool {
	return p[i].ProposedDay < p[j].ProposedDay // <是升序, >是降序, 默认升序
}

func (p ProjectSlice) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p ProjectSlice) Reverse() {
	pLen := len(p)
	for i := 0; i < pLen/2; i++ {
		p[i], p[pLen-i-1] = p[pLen-i-1], p[i]
	}
}
